package com.duobaoyu.dby.supply.biz.client.resource.bean.dto;

import com.duobaoyu.dby.channel.adapter.enums.ChannelCodeEnum;
import com.duobaoyu.dby.channel.adapter.enums.biz.config.RuleTypeEnum;
import com.duobaoyu.dby.channel.adapter.enums.biz.config.ScriptTypeEnum;
import com.duobaoyu.dby.common.core.validator.groups.Add;
import com.duobaoyu.dby.common.core.validator.groups.Edit;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author liyang
 * @version 1.0.0
 * @ClassName ChannelExceptionConfigDTO
 * @createTime 13:53:00 2023/05/08
 */
@Data
public class ChannelRuleConfigBizDTO implements Serializable {

    private static final long serialVersionUID = -545110890424812900L;

    @NotNull(message = "主键ID不能为空",groups = {Edit.class})
    @ApiModelProperty(value = "主键ID")
    private Long id;
    /**
     * 规则类型
	 * @see RuleTypeEnum
     */
    @NotNull(message = "规则类型不能为空",groups = {Add.class,Edit.class})
    @ApiModelProperty(value = "规则类型,1:异常状态")
    private Integer ruleType;
    /**
     * 脚本类型
	 * @see ScriptTypeEnum
     */
    @ApiModelProperty(value = "脚本类型,JavaScript、PHP、Python")
	@NotBlank(message = "脚本类型不能为空", groups = {Add.class, Edit.class})
    private String scriptType;
    /**
     * 供货渠道(渠道编码)
     * @see ChannelCodeEnum
     */
    @NotBlank(message = "渠道编码不能为空",groups = {Add.class,Edit.class})
    @ApiModelProperty(value = "供货渠道")
    private String channelCode;
    /**
     * 供应链Code(本地异常编码)
     */
    @ApiModelProperty(value = "供应链Code")
    private String localExceptionCode;
    /**
     * 接口类型 0->默认
     */
    @ApiModelProperty(value = "接口类型 0->默认")
    private Integer apiType;
    /**
     * 渠道Code(渠道异常编码)
     */
    @ApiModelProperty(value = "渠道Code")
	@Length(max = 30, message = "渠道Code请输入30个字以内", groups = {Add.class, Edit.class})
    private String channelExceptionCode;
    /**
     * 异常描述(渠道异常名称)
     */
    @ApiModelProperty(value = "异常描述")
	@Length(max = 30, message = "异常描述30个字以内", groups = {Add.class, Edit.class})
    private String channelExceptionName;
    /**
     * 解析脚本
     */
    @ApiModelProperty(value = "解析规则")
    private String script;
    /**
     * 规则描述(备注)
     */
    @NotBlank(message = "规则描述不能为空", groups = {Add.class,Edit.class})
	@Length(min = 1, max = 30, message = "规则描述30个字以内", groups = {Add.class, Edit.class})
    @ApiModelProperty(value = "备注")
    private String remark;
}
